<template>
  <div id="box">
    <!--上部-->
    <div class="topbox">
      <div class="tbone">
        <p>3.6</p>
        <p>综合评分</p>
        <p>高于周边商家69.2%</p>
      </div>
      <div class="tbtwo">
        <div>
          <p>服务态度</p>
          <div class="imgs">
            <img src="@/assets/img/star24_on@2x.png" alt="" />
            <img src="@/assets/img/star24_on@2x.png" alt="" />
            <img src="@/assets/img/star24_on@2x.png" alt="" />
            <img src="@/assets/img/star24_on@2x.png" alt="" />
            <img src="@/assets/img/star24_off@2x.png" alt="" />
          </div>
          <p>3.9</p>
        </div>
        <div>
          <p>商品评分</p>
          <div class="imgs">
            <img src="@/assets/img/star24_on@2x.png" alt="" />
            <img src="@/assets/img/star24_on@2x.png" alt="" />
            <img src="@/assets/img/star24_on@2x.png" alt="" />
            <img src="@/assets/img/star24_on@2x.png" alt="" />
            <img src="@/assets/img/star24_off@2x.png" alt="" />
          </div>
          <p>4.0</p>
        </div>
        <div>
          <p>送达时间</p>
          <p>38分钟</p>
        </div>
      </div>
    </div>
    <hr />
    <!--下部-->
    <div class="bottombox">
      <div class="navigation">
        <span>全部57</span>
        <span>满意47</span>
        <span>不满意10</span>
      </div>
      <div class="boxtwo">
        <van-icon name="passed" />
        <span>只看有内容评价</span>
      </div>
    </div>
    <!--评价-->
    <div class="evaluate" v-for="(item,index) in lclist" :key="index">
      <div class="leftbox">
        <img :src="item.avatar" alt="">
      </div>
      <div class="rightbox">
        <div class="name">
          <p>{{item.username}}</p>
          <p>{{item.rateTime|time}}</p>
          </div>
        <div class="title">{{item.text}}</div>
        <div class="label">
          <span v-for="item in item.recommend" :key="item">{{item}}</span>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  components: {},
  name: "",
  data() {
    return {
      lclist:[],
    };
  },
  mounted() {
    this.lcgetlist()
  },
  methods: {
    //获取本地数据
    lcgetlist() {
      this.$axios.get("/json/data.json").then((res) => {
        console.log(res.ratings);
        this.lclist = res.ratings;
      });
    },
  },
  computed: {},
  watch: {},
};
</script>

<style lang="scss" scoped>
#box {
  height: 490px;
  overflow: auto;
  .topbox {
    width: 100%;
    height: 118px;
    padding: 18px 24px;
    text-align: center;
    display: flex;
    align-items: center;
    .tbone {
      width: 138px;
      border-right: 1px solid #c7c7c7;
      p:nth-child(1) {
        font-size: 24px;
        color: rgb(255, 153, 0);
      }
      p:nth-child(2) {
        font-size: 12px;
        color: rgb(7, 17, 27);
      }
      p:nth-child(3) {
        font-size: 10px;
        color: rgb(7, 17, 27);
      }
    }
    .tbtwo {
      padding: 6px 0 6px 12px;
      font-size: 12px;
      div {
        display: flex;
        align-items: center;
        margin-top: 3px;
        p:nth-child(1) {
          margin-right: 6px;
        }
        p:nth-child(2) {
          font-size: 12px;
          color: rgb(147, 153, 159);
        }
        p:nth-child(3) {
          font-size: 12px;
          color: rgb(255, 153, 0);
          margin-left: 6px;
        }
      }
    }
  }
  hr {
    height: 18px;
    border: 0px;
    background-color: #eeeeee;
  }
  .bottombox {
    padding: 0px 24px 0px;
    border-bottom: 1px solid #cacaca;
    .navigation {
      padding: 18px;
      color: white;
      border-bottom: 1px solid #cacaca;
      span {
        padding: 8px 12px;
        margin-right: 6px;
        font-size: 12px;
      }
      span:nth-of-type(1) {
        background-color: #00a0dc;
      }
      span:nth-of-type(2) {
        background-color: rgba(0, 64, 87, 0.2);
      }
      span:nth-of-type(3) {
        background-color: #4d555d;
      }
    }
    .boxtwo {
      padding: 18px 0px;
      display: flex;
      align-items: center;
      color: #7e7e7e;
    }
  }
  .evaluate{
    display: flex;
    padding: 24px;
    .leftbox{
      img{
              height: 20px;
      width: 20px;
      border-radius:50% ;
      }
    }
    .rightbox{
      width: 100%;
      .name{
        display: flex;
        justify-content: space-between;
      }
      .label{
        span{
          display: inline-block;
          
          font-size: 10px;
          padding: 3px 5px;
          margin: 3px 5px;
          border: 1px solid #cfcfcf;
        }
      }
      
    }
  }

}
</style>
